/**
 * 
 */
package com.thon.dao.project.impl;


import java.util.List;

import org.springframework.stereotype.Repository;

import com.thon.dao.project.ProjectCategoryDao;
import com.thon.dao.util.AbstractDao;
import com.thon.entity.project.ProjectCategory;

/**
 * @file ProjectCategoryDaoImpl.java
 * @author Zemo
 * @mail zemochen@gmail.com
 * @data 2013年10月11日 上午11:33:17
 * @description: TODO
 */
@Repository
public class ProjectCategoryDaoImpl extends AbstractDao<ProjectCategory> implements ProjectCategoryDao{
	
	public ProjectCategoryDaoImpl(){
		super(ProjectCategory.class);
	}

	@Override
	public List<ProjectCategory> listCategories() {
		
		String queryString = "FROM ProjectCategory c WHERE type =1 ";
		return findList(queryString, null); 
	}

	@Override
	public List<ProjectCategory> listAllCategories() {
		
		String queryString = "FROM ProjectCategory";
		return findList(queryString, null);
	}
	
	@Override
	public List<ProjectCategory> listCategoriesByType(String type) {
		String queryString = "FROM ProjectCategory WHERE type = ? ORDER BY sort";
		return findList(queryString, null, type);
	}
}
